<?php

function show_movie($item) { ?>
    <div class="item" onclick="window.location = 'movie_detail.php?m_id=<?php echo $item["id"] ?>#container'">
        <div class="image">
            <img src="<?php echo LINK_ROOT . DIR_SHARED_UPLOAD_IMAGES_POSTERS . $item['poster']; ?>">
        </div>
        <div class="content">
            <div class="name"><?php echo $item['title']; ?></div>
            <p class="description">
                <?php
                    if(strlen($item['description']) < 100){
                        echo $item['description'];
                    } else {
                        echo substr($item['description'], 0, 100) . '<span class="ts-red">...[more]</span>';
                    }
                ?>
            </p>
        </div>
    </div>
<?php
}

function show_cinema($item) { ?>
    <div class="item" onclick="window.location = 'cinema_detail.php?c_id=<?php echo $item["id"] ?>'">
        <div class="image">
            <img src="<?php echo LINK_ROOT . DIR_SHARED_UPLOAD_IMAGES_CINEMAS . $item['image'] ?>">
        </div>
        <div class="content">
            <div class="name"><?php echo $item['name']; ?></div>
            <p class="description"><?php echo $item['city_name']; ?></p>
        </div>
    </div>
<?php
}

function show_combo($item) { ?>
    <div class="item">
        <div class="image">
            <img src="<?php echo LINK_ROOT . DIR_SHARED_UPLOAD_IMAGES_COMBOS . '1.png' ?>">
        </div>
        <div class="content">
            <div class="name"><?php echo $item['name']; ?></div>
            <p class="description"><?php echo $item['description']; ?></p>
        </div>
    </div>
<?php
}
?>

